package com.chen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chen.pojo.Likes;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author chen

 */
@Mapper
public interface LikesMapper extends BaseMapper<Likes> {

    @Select("select *from likes where foreign_id=#{foreignId} and liker=#{liker}")
    Likes selectLikes(@Param("foreignId") int foreignId,@Param("liker") String liker);

    @Delete("delete from likes where foreign_id=#{foreignId} and liker=#{liker}")
    int deleteLikes(@Param("foreignId") int foreignId,@Param("liker") String liker);

}
